﻿namespace HuaWei
{
    using DevExpress.Utils;
    using DevExpress.XtraEditors.Controls;
    using DevExpress.XtraEditors.Mask;
    using DevExpress.XtraEditors.Repository;
    using DevExpress.XtraTreeList;
    using DevExpress.XtraTreeList.Columns;
    using DevExpress.XtraTreeList.Nodes;
    using HuaWei.CommClass;
    using HuaWei.Common;
    using HuaWei.DAI;
    using HuaWei.Windows.Forms;
    using System;
    using System.ComponentModel;
    using System.Data;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    public class FrmQDWH : Form
    {
        private string _str;
        private string _str1;
        private BindingNavigator bindingNavigator2;
        public BindingSource bsJLQD;
        private ToolStripButton btnDelAll;
        private ToolStripButton btnDelQD;
        private ToolStripButton btnImport;
        private TreeListColumn colBZ;
        private TreeListColumn colDW1;
        private TreeListColumn colHTJE;
        private TreeListColumn colHTSL;
        private TreeListColumn colQDBH1;
        private TreeListColumn colQDLX;
        private TreeListColumn colQDMC;
        private TreeListColumn colSGTJE;
        private TreeListColumn colSGTSL;
        private TreeListColumn colSGTYX;
        private TreeListColumn colZBDJ;
        private DataSet dataSet = new DataSet();
        public bool hasData;
        private IContainer icontainer = null;
        private ToolStripLabel lblHTJE;
        private int numD = 0;
        [CompilerGenerated]
        private int numD1;
        private ToolStripSeparator onypCxUys;
        private RepositoryItemCheckEdit repositoryItemCheckEdit1;
        private RepositoryItemComboBox repositoryItemComboBox1;
        private RepositoryItemImageComboBox repositoryItemImageComboBox1;
        private RepositoryItemLookUpEdit repositoryItemLookUpEdit1;
        private RepositoryItemLookUpEdit repositoryItemLookUpEdit2;
        private RepositoryItemTextEdit repositoryItemTextEdit1;
        private RepositoryItemTextEdit repositoryItemTextEdit2;
        private RepositoryItemTextEdit repositoryItemTextEdit3;
        private RepositoryItemTextEdit repositoryItemTextEdit4;
        private TreeList tlQD;
        private ToolStripButton toolStripButton1;
        private ToolStripButton toolStripButton4;
        private ToolStripButton toolStripButton5;
        private ToolStripButton toolStripButton6;
        private ToolStripButton toolStripButton7;
        private ToolStripButton toolStripButton8;
        private ToolStripLabel toolStripLabel1;
        private ToolStripSeparator toolStripSeparator1;
        private ToolStripSeparator toolStripSeparator2;
        private ToolStripSeparator toolStripSeparator3;
        private ToolStripSeparator toolStripSeparator4;
        private ToolStripSeparator toolStripSeparator6;
        private ToolStripSeparator toolStripSeparator7;
        private ToolStripSeparator toolStripSeparator8;
        private ToolStripTextBox toolStripTextBox1;
        private TreeListColumn treeListColumn;

        public FrmQDWH()
        {
            this.InitializeComponent();
        }

        private void bsJLQD_PositionChanged(object sender, EventArgs e)
        {
            DataRow dataRow = DHelp.GetDataRow(this.bsJLQD);
            if (dataRow != null)
            {
                if (dataRow["zbcd"].Equals(this.numD))
                {
                    this.tlQD.OptionsBehavior.Editable = true;
                    this.btnDelQD.Enabled = true;
                }
                else
                {
                    this.tlQD.OptionsBehavior.Editable = false;
                    this.btnDelQD.Enabled = false;
                }
            }
        }

        private void btnDelAll_Click(object sender, EventArgs e)
        {
            if ((this.bsJLQD.List.Count > 0) && (MsgBox.ShowQuestion("是否删除全部节点?") == System.Windows.Forms.DialogResult.OK))
            {
                while (this.bsJLQD.List.Count > 0)
                {
                    this.bsJLQD.RemoveCurrent();
                }
                this.bsJLQD.EndEdit();
                this.method3();
            }
        }

        private void btnDelQD_Click(object sender, EventArgs e)
        {
            if ((this.tlQD.FocusedNode != null) && (MsgBox.ShowQuestion("是否删除当前节点及节点下的所有节点?") == System.Windows.Forms.DialogResult.OK))
            {
                this.method9(this.tlQD.FocusedNode);
                this.method3();
            }
        }

        private void btnImport_Click(object sender, EventArgs e)
        {
            OpenFileDialog dialog = new OpenFileDialog();
            dialog.Filter = "Excel文件(xls)|*.xls";
            if (dialog.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                string fileName = dialog.FileName;
                using (FrmDyqd dyqd = new FrmDyqd())
                {
                    dyqd.CJBL = this.YJBFS;
                    dyqd.xmid = this._str;
                    dyqd.bdid = this._str1;
                    dyqd.iniData();
                    if (dyqd.ImportExcel(fileName) && (dyqd.ShowDialog() == System.Windows.Forms.DialogResult.OK))
                    {
                        DataTable tDt = this.dataSet.Tables["JLQD"];
                        DHelp.CopyDt(dyqd.dtQd, tDt);
                        this.method3();
                    }
                }
            }
        }

        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.icontainer != null))
            {
                this.icontainer.Dispose();
            }
            base.Dispose(disposing);
        }

        private void FrmQDWH_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.method4();
        }

        private void FrmQDWH_Load(object sender, EventArgs e)
        {
            this.method();
        }

        public void IniData(string xmid, string bdid, int yjbfs)
        {
            this.YJBFS = yjbfs;
            this._str = xmid;
            this._str1 = bdid;
            this.method5();
            this.dataSet.Tables["JLQD"].TableNewRow += new DataTableNewRowEventHandler(this.method1);
            this.dataSet.Tables["JLQD"].ColumnChanging += new DataColumnChangeEventHandler(this.method2);
            if (!GParams._JGLX.Equals(JGLX.GLY))
            {
                this.numD = 1;
                this.btnImport.Visible = false;
                this.btnDelAll.Visible = false;
                this.onypCxUys.Visible = false;
                this.toolStripSeparator6.Visible = false;
            }
            else
            {
                this.numD = 0;
            }
        }

        private void InitializeComponent()
        {
            this.icontainer = new Container();
            ComponentResourceManager resources = new ComponentResourceManager(typeof(FrmQDWH));
            this.tlQD = new TreeList();
            this.colQDBH1 = new TreeListColumn();
            this.colQDMC = new TreeListColumn();
            this.colDW1 = new TreeListColumn();
            this.colQDLX = new TreeListColumn();
            this.repositoryItemLookUpEdit2 = new RepositoryItemLookUpEdit();
            this.colZBDJ = new TreeListColumn();
            this.repositoryItemTextEdit3 = new RepositoryItemTextEdit();
            this.colHTSL = new TreeListColumn();
            this.repositoryItemTextEdit4 = new RepositoryItemTextEdit();
            this.colSGTSL = new TreeListColumn();
            this.colHTJE = new TreeListColumn();
            this.repositoryItemTextEdit2 = new RepositoryItemTextEdit();
            this.colSGTJE = new TreeListColumn();
            this.treeListColumn = new TreeListColumn();
            this.repositoryItemTextEdit1 = new RepositoryItemTextEdit();
            this.colSGTYX = new TreeListColumn();
            this.repositoryItemCheckEdit1 = new RepositoryItemCheckEdit();
            this.colBZ = new TreeListColumn();
            this.bsJLQD = new BindingSource(this.icontainer);
            this.repositoryItemImageComboBox1 = new RepositoryItemImageComboBox();
            this.repositoryItemComboBox1 = new RepositoryItemComboBox();
            this.repositoryItemLookUpEdit1 = new RepositoryItemLookUpEdit();
            this.bindingNavigator2 = new BindingNavigator(this.icontainer);
            this.toolStripLabel1 = new ToolStripLabel();
            this.toolStripButton4 = new ToolStripButton();
            this.toolStripButton5 = new ToolStripButton();
            this.toolStripSeparator1 = new ToolStripSeparator();
            this.toolStripTextBox1 = new ToolStripTextBox();
            this.toolStripSeparator2 = new ToolStripSeparator();
            this.toolStripButton6 = new ToolStripButton();
            this.toolStripButton7 = new ToolStripButton();
            this.toolStripSeparator3 = new ToolStripSeparator();
            this.toolStripButton8 = new ToolStripButton();
            this.toolStripSeparator4 = new ToolStripSeparator();
            this.toolStripButton1 = new ToolStripButton();
            this.toolStripSeparator7 = new ToolStripSeparator();
            this.btnDelQD = new ToolStripButton();
            this.onypCxUys = new ToolStripSeparator();
            this.btnDelAll = new ToolStripButton();
            this.toolStripSeparator6 = new ToolStripSeparator();
            this.btnImport = new ToolStripButton();
            this.toolStripSeparator8 = new ToolStripSeparator();
            this.lblHTJE = new ToolStripLabel();
            this.tlQD.BeginInit();
            this.repositoryItemLookUpEdit2.BeginInit();
            this.repositoryItemTextEdit3.BeginInit();
            this.repositoryItemTextEdit4.BeginInit();
            this.repositoryItemTextEdit2.BeginInit();
            this.repositoryItemTextEdit1.BeginInit();
            this.repositoryItemCheckEdit1.BeginInit();
            ((ISupportInitialize) this.bsJLQD).BeginInit();
            this.repositoryItemImageComboBox1.BeginInit();
            this.repositoryItemComboBox1.BeginInit();
            this.repositoryItemLookUpEdit1.BeginInit();
            this.bindingNavigator2.BeginInit();
            this.bindingNavigator2.SuspendLayout();
            base.SuspendLayout();
            this.tlQD.Columns.AddRange(new TreeListColumn[] { this.colQDBH1, this.colQDMC, this.colDW1, this.colZBDJ, this.colHTSL, this.colSGTSL, this.colHTJE, this.colSGTJE, this.treeListColumn, this.colSGTYX, this.colBZ, this.colQDLX });
            this.tlQD.DataSource = this.bsJLQD;
            this.tlQD.Dock = DockStyle.Fill;
            this.tlQD.Font = new Font("宋体", 9f, FontStyle.Regular, GraphicsUnit.Point, 0x86);
            this.tlQD.ImageIndexFieldName = "";
            this.tlQD.Location = new Point(0, 0x19);
            this.tlQD.Name = "tlQD";
            this.tlQD.OptionsView.ShowSummaryFooter = true;
            this.tlQD.ParentFieldName = "PID";
            this.tlQD.PreviewFieldName = "QDMC";
            this.tlQD.RepositoryItems.AddRange(new RepositoryItem[] { this.repositoryItemImageComboBox1, this.repositoryItemComboBox1, this.repositoryItemLookUpEdit1, this.repositoryItemLookUpEdit2, this.repositoryItemTextEdit1, this.repositoryItemTextEdit2, this.repositoryItemTextEdit3, this.repositoryItemTextEdit4, this.repositoryItemCheckEdit1 });
            this.tlQD.Size = new Size(0x3df, 0x1fd);
            this.tlQD.TabIndex = 7;
            this.tlQD.TreeLineStyle = LineStyle.None;
            this.tlQD.FocusedNodeChanged += new FocusedNodeChangedEventHandler(this.tlQD_FocusedNodeChanged);
            this.tlQD.CustomDrawNodeCell += new CustomDrawNodeCellEventHandler(this.tlQD_CustomDrawNodeCell);
            this.colQDBH1.Caption = "清单编号";
            this.colQDBH1.FieldName = "QDBH";
            this.colQDBH1.Name = "colQDBH1";
            this.colQDBH1.OptionsColumn.AllowSort = false;
            this.colQDBH1.Visible = true;
            this.colQDBH1.VisibleIndex = 0;
            this.colQDBH1.Width = 0x59;
            this.colQDMC.Caption = "清单名称";
            this.colQDMC.FieldName = "QDMC";
            this.colQDMC.Name = "colQDMC";
            this.colQDMC.OptionsColumn.AllowSort = false;
            this.colQDMC.Visible = true;
            this.colQDMC.VisibleIndex = 1;
            this.colQDMC.Width = 0xb0;
            this.colDW1.Caption = "单位";
            this.colDW1.FieldName = "DW";
            this.colDW1.Name = "colDW1";
            this.colDW1.OptionsColumn.AllowSort = false;
            this.colDW1.Visible = true;
            this.colDW1.VisibleIndex = 2;
            this.colDW1.Width = 0x35;
            this.colQDLX.Caption = "清单类型";
            this.colQDLX.ColumnEdit = this.repositoryItemLookUpEdit2;
            this.colQDLX.FieldName = "QDLX";
            this.colQDLX.Name = "colQDLX";
            this.colQDLX.OptionsColumn.AllowSort = false;
            this.colQDLX.Visible = true;
            this.colQDLX.VisibleIndex = 11;
            this.colQDLX.Width = 0x47;
            this.repositoryItemLookUpEdit2.AutoHeight = false;
            this.repositoryItemLookUpEdit2.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repositoryItemLookUpEdit2.Columns.AddRange(new LookUpColumnInfo[] { new LookUpColumnInfo("code", "code", 20, FormatType.None, "", false, HorzAlignment.Default), new LookUpColumnInfo("value", "value") });
            this.repositoryItemLookUpEdit2.Name = "repositoryItemLookUpEdit2";
            this.colZBDJ.Caption = "单价";
            this.colZBDJ.ColumnEdit = this.repositoryItemTextEdit3;
            this.colZBDJ.FieldName = "ZBDJ";
            this.colZBDJ.Format.FormatString = "0.00";
            this.colZBDJ.Format.FormatType = FormatType.Numeric;
            this.colZBDJ.Name = "colZBDJ";
            this.colZBDJ.OptionsColumn.AllowSort = false;
            this.colZBDJ.Visible = true;
            this.colZBDJ.VisibleIndex = 5;
            this.colZBDJ.Width = 0x2d;
            this.repositoryItemTextEdit3.AutoHeight = false;
            this.repositoryItemTextEdit3.Mask.EditMask = @"\d+(\.\d{1,4})?";
            this.repositoryItemTextEdit3.Mask.MaskType = MaskType.RegEx;
            this.repositoryItemTextEdit3.Name = "repositoryItemTextEdit3";
            this.colHTSL.Caption = "合同数量";
            this.colHTSL.ColumnEdit = this.repositoryItemTextEdit4;
            this.colHTSL.FieldName = "HTSL";
            this.colHTSL.Format.FormatString = "0.000";
            this.colHTSL.Format.FormatType = FormatType.Numeric;
            this.colHTSL.Name = "colHTSL";
            this.colHTSL.OptionsColumn.AllowSort = false;
            this.colHTSL.Visible = true;
            this.colHTSL.VisibleIndex = 3;
            this.colHTSL.Width = 0x3f;
            this.repositoryItemTextEdit4.AutoHeight = false;
            this.repositoryItemTextEdit4.Mask.EditMask = @"\d+(\.\d{1,3})?";
            this.repositoryItemTextEdit4.Mask.MaskType = MaskType.RegEx;
            this.repositoryItemTextEdit4.Name = "repositoryItemTextEdit4";
            this.colSGTSL.Caption = "施工图数量";
            this.colSGTSL.ColumnEdit = this.repositoryItemTextEdit4;
            this.colSGTSL.FieldName = "SGTSL";
            this.colSGTSL.Format.FormatString = "0.000";
            this.colSGTSL.Format.FormatType = FormatType.Numeric;
            this.colSGTSL.Name = "colSGTSL";
            this.colSGTSL.Visible = true;
            this.colSGTSL.VisibleIndex = 4;
            this.colHTJE.Caption = "合同金额";
            this.colHTJE.ColumnEdit = this.repositoryItemTextEdit2;
            this.colHTJE.FieldName = "HTJE";
            this.colHTJE.Format.FormatString = "0";
            this.colHTJE.Format.FormatType = FormatType.Numeric;
            this.colHTJE.Name = "colHTJE";
            this.colHTJE.OptionsColumn.AllowSort = false;
            this.colHTJE.SummaryFooter = SummaryItemType.Sum;
            this.colHTJE.Visible = true;
            this.colHTJE.VisibleIndex = 6;
            this.colHTJE.Width = 70;
            this.repositoryItemTextEdit2.AutoHeight = false;
            this.repositoryItemTextEdit2.Mask.EditMask = @"\d+";
            this.repositoryItemTextEdit2.Mask.MaskType = MaskType.RegEx;
            this.repositoryItemTextEdit2.Name = "repositoryItemTextEdit2";
            this.repositoryItemTextEdit2.ValidateOnEnterKey = true;
            this.colSGTJE.Caption = "施工图金额";
            this.colSGTJE.ColumnEdit = this.repositoryItemTextEdit2;
            this.colSGTJE.FieldName = "SGTJE";
            this.colSGTJE.Format.FormatString = "0";
            this.colSGTJE.Format.FormatType = FormatType.Numeric;
            this.colSGTJE.Name = "colSGTJE";
            this.colSGTJE.Visible = true;
            this.colSGTJE.VisibleIndex = 7;
            this.colSGTJE.Width = 0x57;
            this.treeListColumn.Caption = "超计比例 %";
            this.treeListColumn.ColumnEdit = this.repositoryItemTextEdit1;
            this.treeListColumn.FieldName = "ZKCJBL";
            this.treeListColumn.Name = "colZKCJBL";
            this.treeListColumn.OptionsColumn.AllowSort = false;
            this.treeListColumn.Visible = true;
            this.treeListColumn.VisibleIndex = 8;
            this.treeListColumn.Width = 0x5e;
            this.repositoryItemTextEdit1.AutoHeight = false;
            this.repositoryItemTextEdit1.Name = "repositoryItemTextEdit1";
            this.colSGTYX.Caption = "施工图生效";
            this.colSGTYX.ColumnEdit = this.repositoryItemCheckEdit1;
            this.colSGTYX.FieldName = "SGTYX";
            this.colSGTYX.Name = "colSGTYX";
            this.colSGTYX.Visible = true;
            this.colSGTYX.VisibleIndex = 9;
            this.repositoryItemCheckEdit1.AutoHeight = false;
            this.repositoryItemCheckEdit1.DisplayValueChecked = "1";
            this.repositoryItemCheckEdit1.DisplayValueUnchecked = "0";
            this.repositoryItemCheckEdit1.Name = "repositoryItemCheckEdit1";
            this.repositoryItemCheckEdit1.NullStyle = StyleIndeterminate.Unchecked;
            this.repositoryItemCheckEdit1.ValueChecked = 1;
            this.repositoryItemCheckEdit1.ValueUnchecked = 0;
            this.colBZ.Caption = "备注";
            this.colBZ.FieldName = "BZ";
            this.colBZ.Name = "colBZ";
            this.colBZ.OptionsColumn.AllowSort = false;
            this.colBZ.Visible = true;
            this.colBZ.VisibleIndex = 10;
            this.colBZ.Width = 0x48;
            this.bsJLQD.DataMember = "JLQD";
            this.bsJLQD.PositionChanged += new EventHandler(this.bsJLQD_PositionChanged);
            this.repositoryItemImageComboBox1.AutoHeight = false;
            this.repositoryItemImageComboBox1.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repositoryItemImageComboBox1.Items.AddRange(new ImageComboBoxItem[] { new ImageComboBoxItem("", "1", 1), new ImageComboBoxItem("", "2", 5), new ImageComboBoxItem("", "3", 11) });
            this.repositoryItemImageComboBox1.Name = "repositoryItemImageComboBox1";
            this.repositoryItemComboBox1.AutoHeight = false;
            this.repositoryItemComboBox1.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repositoryItemComboBox1.Items.AddRange(new object[] { "普通清单", "计日工", "暂定金" });
            this.repositoryItemComboBox1.Name = "repositoryItemComboBox1";
            this.repositoryItemLookUpEdit1.AutoHeight = false;
            this.repositoryItemLookUpEdit1.Buttons.AddRange(new EditorButton[] { new EditorButton(ButtonPredefines.Combo) });
            this.repositoryItemLookUpEdit1.Name = "repositoryItemLookUpEdit1";
            this.bindingNavigator2.AddNewItem = null;
            this.bindingNavigator2.AutoSize = false;
            this.bindingNavigator2.BindingSource = this.bsJLQD;
            this.bindingNavigator2.CanOverflow = false;
            this.bindingNavigator2.CountItem = this.toolStripLabel1;
            this.bindingNavigator2.DeleteItem = null;
            this.bindingNavigator2.Items.AddRange(new ToolStripItem[] { 
                this.toolStripButton4, this.toolStripButton5, this.toolStripSeparator1, this.toolStripTextBox1, this.toolStripLabel1, this.toolStripSeparator2, this.toolStripButton6, this.toolStripButton7, this.toolStripSeparator3, this.toolStripButton8, this.toolStripSeparator4, this.toolStripButton1, this.toolStripSeparator7, this.btnDelQD, this.onypCxUys, this.btnDelAll, 
                this.toolStripSeparator6, this.btnImport, this.toolStripSeparator8, this.lblHTJE
             });
            this.bindingNavigator2.Location = new Point(0, 0);
            this.bindingNavigator2.MoveFirstItem = this.toolStripButton4;
            this.bindingNavigator2.MoveLastItem = this.toolStripButton7;
            this.bindingNavigator2.MoveNextItem = this.toolStripButton6;
            this.bindingNavigator2.MovePreviousItem = this.toolStripButton5;
            this.bindingNavigator2.Name = "bindingNavigator2";
            this.bindingNavigator2.PositionItem = this.toolStripTextBox1;
            this.bindingNavigator2.RenderMode = ToolStripRenderMode.System;
            this.bindingNavigator2.Size = new Size(0x3df, 0x19);
            this.bindingNavigator2.TabIndex = 0x12;
            this.bindingNavigator2.Text = "bindingNavigator2";
            this.toolStripLabel1.Name = "toolStripLabel1";
            this.toolStripLabel1.Size = new Size(0x20, 0x16);
            this.toolStripLabel1.Text = "/ {0}";
            this.toolStripLabel1.ToolTipText = "总项数";
            this.toolStripButton4.DisplayStyle = ToolStripItemDisplayStyle.Image;
            this.toolStripButton4.Image = (Image) resources.GetObject("toolStripButton4.Image");
            this.toolStripButton4.Name = "toolStripButton4";
            this.toolStripButton4.RightToLeftAutoMirrorImage = true;
            this.toolStripButton4.Size = new Size(0x17, 0x16);
            this.toolStripButton4.Tag = "-3";
            this.toolStripButton4.Text = "移到第一条记录";
            this.toolStripButton5.DisplayStyle = ToolStripItemDisplayStyle.Image;
            this.toolStripButton5.Image = (Image) resources.GetObject("toolStripButton5.Image");
            this.toolStripButton5.Name = "toolStripButton5";
            this.toolStripButton5.RightToLeftAutoMirrorImage = true;
            this.toolStripButton5.Size = new Size(0x17, 0x16);
            this.toolStripButton5.Tag = "-3";
            this.toolStripButton5.Text = "移到上一条记录";
            this.toolStripSeparator1.Name = "toolStripSeparator1";
            this.toolStripSeparator1.Size = new Size(6, 0x19);
            this.toolStripTextBox1.AccessibleName = "位置";
            this.toolStripTextBox1.AutoSize = false;
            this.toolStripTextBox1.Name = "toolStripTextBox1";
            this.toolStripTextBox1.Size = new Size(50, 0x15);
            this.toolStripTextBox1.Tag = "-3";
            this.toolStripTextBox1.Text = "0";
            this.toolStripTextBox1.ToolTipText = "当前位置";
            this.toolStripSeparator2.Name = "toolStripSeparator2";
            this.toolStripSeparator2.Size = new Size(6, 0x19);
            this.toolStripButton6.DisplayStyle = ToolStripItemDisplayStyle.Image;
            this.toolStripButton6.Image = (Image) resources.GetObject("toolStripButton6.Image");
            this.toolStripButton6.Name = "toolStripButton6";
            this.toolStripButton6.RightToLeftAutoMirrorImage = true;
            this.toolStripButton6.Size = new Size(0x17, 0x16);
            this.toolStripButton6.Tag = "-3";
            this.toolStripButton6.Text = "移到下一条记录";
            this.toolStripButton7.DisplayStyle = ToolStripItemDisplayStyle.Image;
            this.toolStripButton7.Image = (Image) resources.GetObject("toolStripButton7.Image");
            this.toolStripButton7.Name = "toolStripButton7";
            this.toolStripButton7.RightToLeftAutoMirrorImage = true;
            this.toolStripButton7.Size = new Size(0x17, 0x16);
            this.toolStripButton7.Tag = "-3";
            this.toolStripButton7.Text = "移到最后一条记录";
            this.toolStripSeparator3.Name = "toolStripSeparator3";
            this.toolStripSeparator3.Size = new Size(6, 0x19);
            this.toolStripButton8.DisplayStyle = ToolStripItemDisplayStyle.Text;
            this.toolStripButton8.Image = (Image) resources.GetObject("toolStripButton8.Image");
            this.toolStripButton8.ImageTransparentColor = Color.Magenta;
            this.toolStripButton8.Name = "toolStripButton8";
            this.toolStripButton8.Size = new Size(60, 0x16);
            this.toolStripButton8.Tag = "-1";
            this.toolStripButton8.Text = "新增同级";
            this.toolStripButton8.Click += new EventHandler(this.toolStripButton8_Click);
            this.toolStripSeparator4.Name = "toolStripSeparator4";
            this.toolStripSeparator4.Size = new Size(6, 0x19);
            this.toolStripButton1.DisplayStyle = ToolStripItemDisplayStyle.Text;
            this.toolStripButton1.Image = (Image) resources.GetObject("toolStripButton1.Image");
            this.toolStripButton1.ImageTransparentColor = Color.Magenta;
            this.toolStripButton1.Name = "toolStripButton1";
            this.toolStripButton1.Size = new Size(60, 0x16);
            this.toolStripButton1.Tag = "-1";
            this.toolStripButton1.Text = "新增下级";
            this.toolStripButton1.Click += new EventHandler(this.toolStripButton1_Click);
            this.toolStripSeparator7.Name = "toolStripSeparator7";
            this.toolStripSeparator7.Size = new Size(6, 0x19);
            this.btnDelQD.DisplayStyle = ToolStripItemDisplayStyle.Text;
            this.btnDelQD.Image = (Image) resources.GetObject("btnDelQD.Image");
            this.btnDelQD.ImageTransparentColor = Color.Magenta;
            this.btnDelQD.Name = "btnDelQD";
            this.btnDelQD.Size = new Size(0x24, 0x16);
            this.btnDelQD.Tag = "-1";
            this.btnDelQD.Text = "删除";
            this.btnDelQD.Click += new EventHandler(this.btnDelQD_Click);
            this.onypCxUys.Name = "toolStripSeparator5";
            this.onypCxUys.Size = new Size(6, 0x19);
            this.btnDelAll.DisplayStyle = ToolStripItemDisplayStyle.Text;
            this.btnDelAll.Image = (Image) resources.GetObject("btnDelAll.Image");
            this.btnDelAll.ImageTransparentColor = Color.Magenta;
            this.btnDelAll.Name = "btnDelAll";
            this.btnDelAll.Size = new Size(60, 0x16);
            this.btnDelAll.Tag = "-1";
            this.btnDelAll.Text = "全部删除";
            this.btnDelAll.Click += new EventHandler(this.btnDelAll_Click);
            this.toolStripSeparator6.Name = "toolStripSeparator6";
            this.toolStripSeparator6.Size = new Size(6, 0x19);
            this.btnImport.DisplayStyle = ToolStripItemDisplayStyle.Text;
            this.btnImport.Image = (Image) resources.GetObject("btnImport.Image");
            this.btnImport.ImageTransparentColor = Color.Magenta;
            this.btnImport.Name = "btnImport";
            this.btnImport.Size = new Size(60, 0x16);
            this.btnImport.Tag = "-1";
            this.btnImport.Text = "导入向导";
            this.btnImport.Click += new EventHandler(this.btnImport_Click);
            this.toolStripSeparator8.Name = "toolStripSeparator8";
            this.toolStripSeparator8.Size = new Size(6, 0x19);
            this.lblHTJE.ForeColor = Color.Red;
            this.lblHTJE.Name = "lblHTJE";
            this.lblHTJE.Size = new Size(0, 0x16);
            base.AutoScaleDimensions = new SizeF(6f, 12f);
            base.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            base.ClientSize = new Size(0x3df, 0x216);
            base.Controls.Add(this.tlQD);
            base.Controls.Add(this.bindingNavigator2);
            base.Name = "FrmQDWH";
            base.StartPosition = FormStartPosition.CenterParent;
            this.Text = "清单维护";
            base.WindowState = FormWindowState.Maximized;
            base.FormClosing += new FormClosingEventHandler(this.FrmQDWH_FormClosing);
            base.Load += new EventHandler(this.FrmQDWH_Load);
            this.tlQD.EndInit();
            this.repositoryItemLookUpEdit2.EndInit();
            this.repositoryItemTextEdit3.EndInit();
            this.repositoryItemTextEdit4.EndInit();
            this.repositoryItemTextEdit2.EndInit();
            this.repositoryItemTextEdit1.EndInit();
            this.repositoryItemCheckEdit1.EndInit();
            ((ISupportInitialize) this.bsJLQD).EndInit();
            this.repositoryItemImageComboBox1.EndInit();
            this.repositoryItemComboBox1.EndInit();
            this.repositoryItemLookUpEdit1.EndInit();
            this.bindingNavigator2.EndInit();
            this.bindingNavigator2.ResumeLayout(false);
            this.bindingNavigator2.PerformLayout();
            base.ResumeLayout(false);
        }

        private void method()
        {
            DataTable table = new DataTable();
            table.Columns.Add("code", typeof(int));
            table.Columns.Add("value", typeof(string));
            DataRow row = table.NewRow();
            row["code"] = 0;
            row["value"] = "普通";
            table.Rows.Add(row);
            row = table.NewRow();
            row["code"] = 1;
            row["value"] = "计日工";
            table.Rows.Add(row);
            row = table.NewRow();
            row["code"] = 2;
            row["value"] = "暂列金";
            table.Rows.Add(row);
            row = table.NewRow();
            row["code"] = 3;
            row["value"] = "专项暂列金";
            table.Rows.Add(row);
            RepositoryItemLookUpEdit columnEdit = (RepositoryItemLookUpEdit) this.colQDLX.ColumnEdit;
            columnEdit.DataSource = table;
            columnEdit.DisplayMember = "value";
            columnEdit.ValueMember = "code";
        }

        private void method1(object sender, DataTableNewRowEventArgs e)
        {
            e.Row["id"] = Guid.NewGuid();
            e.Row["pid"] = -1;
            e.Row["xmid"] = this._str;
            e.Row["bdid"] = this._str1;
            e.Row["BGHSL"] = 0;
            e.Row["HTSL"] = 0;
            e.Row["SGTSL"] = 0;
            e.Row["HTJE"] = 0;
            e.Row["SGTJE"] = 0;
            e.Row["BGHSL"] = 0;
            e.Row["BGHJE"] = 0;
            e.Row["DJZD"] = 0;
            e.Row["ZXZDJ"] = 0;
            e.Row["ZBDJ"] = 0;
            e.Row["XXDJ"] = 0;
            e.Row["QDLX"] = 0;
            e.Row["SGTYX"] = 0;
            e.Row["ZKCJBL"] = this.YJBFS;
            e.Row["zbcd"] = this.numD;
        }

        private void method2(object sender, DataColumnChangeEventArgs e)
        {
            if (e.Column.ColumnName.ToUpper().Equals("HTJE") && (this.tlQD.FocusedNode != null))
            {
                TreeListNode rootNode = this.tlQD.FocusedNode.RootNode;
                if (!e.Row["CJM"].Equals("0"))
                {
                    decimal num = CHelp.ConvertDecimal(e.ProposedValue, 0, 0) - CHelp.ConvertDecimal(e.Row["HTJE"], 0, 0);
                    if (!num.Equals((decimal) 0M))
                    {
                        decimal decimal1 = CHelp.ConvertDecimal(rootNode.GetValue(this.colHTJE), 0, 0) + num;
                        this.method3();
                    }
                }
            }
        }

        private void method3()
        {
            this.lblHTJE.Text = "    金额汇总:" + CHelp.ConvertDecimal(this.dataSet.Tables["JLQD"].Compute("sum(htje)", "CJM=0"), 0, 0).ToString() + "元";
        }

        private void method4()
        {
            this.bsJLQD.EndEdit();
            if (this.dataSet.HasChanges())
            {
                IDataAccess access = DBHelp.IniIDA();
                access.OpenDatabase();
                access.BeginTrans();
                try
                {
                    access.Update(this.dataSet, true);
                    access.Commit();
                }
                catch (Exception exception)
                {
                    access.RollBack();
                    MsgBox.ShowError("导入的清单有误，请与管理员系统！", exception);
                }
                finally
                {
                    access.CloseDatabase();
                }
            }
            this.hasData = this.bsJLQD.List.Count > 0;
            base.DialogResult = System.Windows.Forms.DialogResult.OK;
        }

        private void method5()
        {
            this.dataSet.Clear();
            IDataAccess access = DBHelp.IniIDA();
            this.dataSet.Merge(access.ExecuteDataSet("select * from JLQD where bdid='" + this._str1 + "' order by qdbh", CommandType.Text, "JLQD"));
            this.bsJLQD.DataSource = this.dataSet.Tables["JLQD"];
            this.method3();
            access.CloseDatabase();
        }

        private void method6(object sender, EventArgs e)
        {
        }

        private DataRow method7(string _str2)
        {
            DataTable table = this.dataSet.Tables["JLQD"];
            DataRow row = table.NewRow();
            row["pid"] = _str2;
            table.Rows.Add(row);
            this.bsJLQD.MoveLast();
            return row;
        }

        private void method8(bool _flag)
        {
            DataRow row = null;
            if (!_flag)
            {
                if (this.tlQD.FocusedNode != null)
                {
                    if (this.tlQD.FocusedNode.ParentNode == null)
                    {
                        row = this.method7("-1");
                    }
                    else
                    {
                        string str = DHelp.GetDataRow(this.bsJLQD)["pid"].ToString();
                        row = this.method7(str);
                    }
                }
                else
                {
                    row = this.method7("-1");
                }
            }
            else
            {
                row = DHelp.DataAddNewChild(this.bsJLQD, false, this._str1);
            }
            if (row != null)
            {
                row["CJM"] = this.tlQD.FocusedNode.Level;
            }
        }

        private void method9(TreeListNode treeListNode)
        {
            if (treeListNode.HasChildren)
            {
                while (treeListNode.Nodes.Count > 0)
                {
                    this.method9(treeListNode.Nodes[0]);
                }
                this.method9(treeListNode);
            }
            else
            {
                TreeListNode rootNode = treeListNode.RootNode;
                if ((rootNode != null) && rootNode.HasChildren)
                {
                    decimal val = CHelp.ConvertDecimal(rootNode.GetValue(this.colHTJE), 0, 0) - CHelp.ConvertDecimal(treeListNode.GetValue(this.colHTJE), 0, 0);
                    this.tlQD.DeleteNode(treeListNode);
                    rootNode.SetValue(this.colHTJE, val);
                }
                else
                {
                    this.tlQD.DeleteNode(treeListNode);
                }
            }
        }

        private void tlQD_CustomDrawNodeCell(object sender, CustomDrawNodeCellEventArgs e)
        {
            if ((e.CellText.ToString().Equals("0") || e.CellText.ToString().Equals("0.00")) || e.CellText.ToString().Equals("0.000"))
            {
                e.CellText = "";
            }
        }

        private void tlQD_FocusedNodeChanged(object sender, FocusedNodeChangedEventArgs e)
        {
        }

        private void toolStripButton1_Click(object sender, EventArgs e)
        {
            this.method8(true);
        }

        private void toolStripButton8_Click(object sender, EventArgs e)
        {
            this.method8(false);
        }

        public int YJBFS
        {
            [CompilerGenerated]
            get
            {
                return this.numD1;
            }
            [CompilerGenerated]
            set
            {
                this.numD1 = value;
            }
        }
    }
}

